package com.ssy.lingxi.workflow.api.model.vo.request;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 任务执行接口参数（连续执行任务）
 * @author 万宁
 * @version 2.0.0
 * @date 2021-04-26
 */
public class SerialTaskExecuteVO implements Serializable {
    private static final long serialVersionUID = -411765733126162085L;

    public SerialTaskExecuteVO() {
        this.processKey = "";
        this.taskId = "";
        this.memberId = 0L;
        this.roleId = 0L;
        this.execTimes = 0;
        this.agrees = new ArrayList<>();
        this.dataId = 0L;
    }

    /**
     * 流程的Key
     */
    @NotEmpty(message = "流程的Key不能为空")
    private String processKey;

    /**
     * 要执行的任务Id
     */
    @NotEmpty(message = "任务Id不能为空")
    private String taskId;

    /**
     * 启动流程的会员Id
     */
    @NotNull(message = "会员Id要大于0")
    @Positive(message = "会员Id要大于0")
    private Long memberId;

    /**
     * 启动流程的会员角色Id
     */
    @NotNull(message = "会员角色Id要大于0")
    @Positive(message = "会员角色Id要大于0")
    private Long roleId;

    /**
     * 执行次数
     */
    @NotNull(message = "执行次数要大于等于2")
    @Min(value = 2, message = "执行次数要大于等于2")
    private Integer execTimes;

    /**
     * 流程跳转条件列表，按照任务跳转参数依次排序，可包含Null表示当次任务无跳转
     */
    @NotEmpty(message = "流程跳转条件列表不能为空")
    private List<Integer> agrees;

    /**
     * 数据Id
     */
    @NotNull(message = "数据Id要大于等于0")
    @PositiveOrZero(message = "数据Id要大于等于0")
    private Long dataId;

    public String getProcessKey() {
        return processKey;
    }

    public void setProcessKey(String processKey) {
        this.processKey = processKey;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Integer getExecTimes() {
        return execTimes;
    }

    public void setExecTimes(Integer execTimes) {
        this.execTimes = execTimes;
    }

    public List<Integer> getAgrees() {
        return agrees;
    }

    public void setAgrees(List<Integer> agrees) {
        this.agrees = agrees;
    }

    public Long getDataId() {
        return dataId;
    }

    public void setDataId(Long dataId) {
        this.dataId = dataId;
    }
}
